<html>
  <head>
<title>bt5</title>
<meta charset="utf-8">
<link rel="stylesheet" href="pheptinh.css">
</head>
<body>
  <?php
     $cpt_selected = $_GET['cpt_group'];
     $fSothunhat = $_GET['stn'];
     $fSothuhai = $_GET['sth'];

     if (!is_numeric($fSothunhat) || !is_numeric($fSothuhai) || ($fSothuhai == 0 && $cpt_selected == "Chia"))
     {
	echo '<script type="text/javascript">', 'javascript:window.history.back(-1);' , '</script>';
     }
     
     if ($cpt_selected == "Cộng")
	$fKetqua = $fSothunhat + $fSothuhai;
     else if ($cpt_selected == "Trừ")
	$fKetqua = $fSothunhat - $fSothuhai;
     else if ($cpt_selected == "Nhân")
	$fKetqua = $fSothunhat * $fSothuhai;
     else
	$fKetqua = $fSothunhat / $fSothuhai;
  ?>
<h1>bt5</h1>
<h1>PHÉP TÍNH TRÊN HAI SỐ</h1>
<form>
  <table>
    <tr id="cpt_row"><td class="heading"><span class="heading" id="cpt_heading">Chọn phép tính:</span></td>
      <td>
	<?php echo $cpt_selected; ?>
    </td>
  </tr>
<tr>
  <td class="heading">
  <span class="heading">Số thứ nhất:</span>
    </td>
  <td>
    <?php echo "<input type=\"text\" id=\"stn_nhap\" value=\""  . $fSothunhat . "\">" ; ?>
  </td>
</tr>
<tr>
<td class="heading">
  <span class="heading">Số thứ hai:</span></td>
<td>
  <?php echo "<input type=\"text\" id=\"sth_nhap\" value=\""  . $fSothuhai . "\">" ?></td>
</tr>
<tr>
<td class="heading">
  <span class="heading">Kết quả:</span></td>
<td>
  <?php echo "<input type=\"text\" id=\"ketqua_nhap\" value=\""  . $fKetqua . "\">"?></td>
</tr>

  <tr><td></td><td><a href="javascript:window.history.back(-1);">Trở về trang trước</a></td>
  </form>
<!-- Taị sao nó laị xuất hiện không đúng chỗ ??? -->
<address>
<a href="mailto:thienhome123@thienhome123-PC">U-thienhome123-PC\thienhome123</a>
</address>
</body>
</html>
